﻿<Window x:Class="BeinDemo1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:myvmod="clr-namespace:BeinDemo1.ViewModel"
        xmlns:myview="clr-namespace:BeinDemo1"
        Title="Demo 1 - AMEE Bein Kontroller" Height="600" Width="800">
    <Window.Resources>
        <!--<ResourceDictionary Source="Resources/ResourceDictionary.xaml" />-->
        <!--<DataTemplate DataType="{x:Type vmod:StepperVM}">
            <view:StepperView />
        </DataTemplate>-->
    </Window.Resources>
    <Grid>
        <TabControl>
            
            <!-- <TabControl.Resources>
                <myv
            </TabControl.Resources>
            <TabControl.DataContext>
                <Binding Source="{StaticResource mainWindowViwModel}" />
            </TabControl.DataContext> -->
            <TabItem Name="TabSettings" Header="Settings">
                <TabItem.InputBindings>
                    <KeyBinding Command="{Binding SaveSettingsCommand}" Key="s" Modifiers="Ctrl"/>
                </TabItem.InputBindings>
                <Grid Background="#FFE5E5E5">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*" />
                        <ColumnDefinition Width="3*" />
                        <ColumnDefinition Width="1*" />
                        <ColumnDefinition Width="3*" />
                        <ColumnDefinition Width="1*" />
                        <ColumnDefinition Width="3*" />
                        <ColumnDefinition Width="1*" />
                        <ColumnDefinition Width="3*" />
                    </Grid.ColumnDefinitions>
                    <Label Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Content="Bein Vorne Links" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    <Label Content="ID" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <Label Content="IPv4" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <Label Content="Port" Grid.Column="0" Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VLID}" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                    <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VLIP}" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="90" />
                    <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VLPort}" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />

                    <Label Grid.Column="2" Grid.Row="0" Grid.ColumnSpan="2" Content="Bein Vorne Rechts" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    <Label Content="ID" Grid.Column="2" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <Label Content="IPv4" Grid.Column="2" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <Label Content="Port" Grid.Column="2" Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VRID}" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                    <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VRIP}" Grid.Column="3" Grid.Row="2" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="90" />
                    <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VRPort}" Grid.Column="3" Grid.Row="3" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />

                    <Label Grid.Column="4" Grid.Row="0" Grid.ColumnSpan="2" Content="Bein Hinten Links" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    <Label Content="ID" Grid.Column="4" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <Label Content="IPv4" Grid.Column="4" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <Label Content="Port" Grid.Column="4" Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HLID}" Grid.Column="5" Grid.Row="1" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                    <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HLIP}" Grid.Column="5" Grid.Row="2" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="90" />
                    <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HLPort}" Grid.Column="5" Grid.Row="3" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />

                    <Label Grid.Column="6" Grid.Row="0" Grid.ColumnSpan="2" Content="Bein Hinten Rechts" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    <Label Content="ID" Grid.Column="6" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <Label Content="IPv4" Grid.Column="6" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <Label Content="Port" Grid.Column="6" Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HRID}" Grid.Column="7" Grid.Row="1" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                    <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HRIP}" Grid.Column="7" Grid.Row="2" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="90" />
                    <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HRPort}" Grid.Column="7" Grid.Row="3" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />

                    <Label Content="adc Werte" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    <Label Content="Up" Grid.Column="0" Grid.Row="5" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="5">
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VL_A_Up_adc}" ToolTip="A" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VL_B_Up_adc}" ToolTip="B" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VL_C_Up_adc}" ToolTip="C" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VL_D_Up_adc}" ToolTip="D" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                    </StackPanel>
                    <Label Content="Down" Grid.Column="0" Grid.Row="6" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0" Padding="0,0,0,0"/>
                    <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="6">
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VL_A_Down_adc}" ToolTip="A" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VL_B_Down_adc}" ToolTip="B" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VL_C_Down_adc}" ToolTip="C" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VL_D_Down_adc}" ToolTip="D" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                    </StackPanel>

                    <Label Content="Up" Grid.Column="2" Grid.Row="5" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="5">
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VR_A_Up_adc}" ToolTip="A" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VR_B_Up_adc}" ToolTip="B" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VR_C_Up_adc}" ToolTip="C" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VR_D_Up_adc}" ToolTip="D" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                    </StackPanel>
                    <Label Content="Down" Grid.Column="2" Grid.Row="6" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0" Padding="0,0,0,0"/>
                    <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="6">
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VR_A_Down_adc}" ToolTip="A" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VR_B_Down_adc}" ToolTip="B" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VR_C_Down_adc}" ToolTip="C" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.VR_D_Down_adc}" ToolTip="D" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                    </StackPanel>

                    <Label Content="Up" Grid.Column="4" Grid.Row="5" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <StackPanel Orientation="Horizontal" Grid.Column="5" Grid.Row="5">
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HL_A_Up_adc}" ToolTip="A" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HL_B_Up_adc}" ToolTip="B" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HL_C_Up_adc}" ToolTip="C" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HL_D_Up_adc}" ToolTip="D" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                    </StackPanel>
                    <Label Content="Down" Grid.Column="4" Grid.Row="6" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0" Padding="0,0,0,0"/>
                    <StackPanel Orientation="Horizontal" Grid.Column="5" Grid.Row="6">
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HL_A_Down_adc}" ToolTip="A" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HL_B_Down_adc}" ToolTip="B" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HL_C_Down_adc}" ToolTip="C" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HL_D_Down_adc}" ToolTip="D" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                    </StackPanel>

                    <Label Content="Up" Grid.Column="6" Grid.Row="5" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,0"/>
                    <StackPanel Orientation="Horizontal" Grid.Column="7" Grid.Row="5">
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HR_A_Up_adc}" ToolTip="A" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HR_B_Up_adc}" ToolTip="B" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HR_C_Up_adc}" ToolTip="C" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HR_D_Up_adc}" ToolTip="D" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                    </StackPanel>
                    <Label Content="Down" Grid.Column="6" Grid.Row="6" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0" Padding="0,0,0,0"/>
                    <StackPanel Orientation="Horizontal" Grid.Column="7" Grid.Row="6">
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HR_A_Down_adc}" ToolTip="A" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HR_B_Down_adc}" ToolTip="B" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HR_C_Down_adc}" ToolTip="C" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                        <TextBox Text="{Binding Source={StaticResource Settings}, Path=Default.HR_D_Down_adc}" ToolTip="D" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center" Width="35" />
                    </StackPanel>
                    <Button Grid.Column="7" HorizontalAlignment="Center" Margin="0,20,0,20" Grid.Row="7" VerticalAlignment="Bottom" Width="64">
                        <Button.ToolTip>Übernehmen der aktuellen Werte</Button.ToolTip>
                        <Image Source="Resources\Import 96x96.ico" IsEnabled="False"/>
                    </Button>
                </Grid>
            </TabItem>
            <!-- TODO Binding IsEnabled zeigt keine Wirkung. Aber keine Binding Error vorhanden!-->
            <TabItem Name="TabControl" Header="Control" IsEnabled="{Binding IsConnectedToLegs}">
                
                <Grid Background="#FFE5E5E5">
                    
                    <Button x:Name="StepButton" Command="{Binding RunCommand}" CommandParameter="One" HorizontalAlignment="Left" Margin="28,34,0,0" VerticalAlignment="Top" Background="Transparent" Height="128" Width="128" BorderBrush="Transparent">
                        <Image Source="Resources\Step 128x128.ico" />
                        <Button.ToolTip>Einen Schrittzyklus ausführen</Button.ToolTip>
                    </Button>
                    <Button x:Name="WalkButton" Command="{Binding RunCommand}" CommandParameter="Multiple" HorizontalAlignment="Left" Margin="312,34,0,0" VerticalAlignment="Top" Background="Transparent" Height="128" Width="128" BorderBrush="Transparent">
                        <Image Source="Resources\Play 128x128.ico" />
                        <Button.ToolTip>Mehrere (5) Schrittzyklen ausführen</Button.ToolTip>
                    </Button>
                    <Button x:Name="ShutDownButton" Command="{Binding ShutDownCommand}" HorizontalAlignment="Left" Margin="667,34,0,0" VerticalAlignment="Top" Background="Transparent" Height="96" Width="96" BorderBrush="Transparent">
                        <Button.Effect>
                            <DropShadowEffect/>
                        </Button.Effect>
                        <Image Source="Resources\Disconnect 96x96.ico" />
                        <Button.ToolTip>TCP Verbindung trennen</Button.ToolTip>
                    </Button>
                </Grid>
            </TabItem>
        </TabControl>

    </Grid>
</Window>
